import $http from '../../../servers/http';
import { Result } from '../../schema/Result';

import { EditSeatGroupParams, GetSeatGroupListParams, SeatGroupInfo } from 'admin/schema/SeatGroup';
/* 坐席组管理
---------------------------------------------------------------- */

/**新增坐席组 */
export const addSeatGroup = (data: EditSeatGroupParams): Promise<Result<null>> => {
  return $http.post({
    url: '/sso/seatGroup',
    data,
  });
};

/** 删除坐席组 */
export const delSeatGroup = (SeatgroupId: number): Promise<Result<null>> => {
  return $http.delete({
    url: `/sso/seatGroup/${SeatgroupId}`,
  });
};

/**编辑坐席组 */
export const modifySeatGroup = (
  SeatgroupId: number,
  data: EditSeatGroupParams
): Promise<Result<null>> => {
  return $http.put({
    url: `/sso/seatGroup/${SeatgroupId}`,
    data,
  });
};

/**获取坐席组列表 */
export const getSeatGroupList = (
  data: GetSeatGroupListParams
): Promise<Result<SeatGroupInfo[]>> => {
  return $http.get({
    url: '/sso/seatGroup',
    data,
  });
};

/**移入坐席组 */
export const moveInSeatGroup = (data: {
  seatGroupId: number;
  seatIds: Array<number>;
}): Promise<Result<null>> => {
  return $http.post({
    url: '/sso/seatGroup/seatmovein',
    data,
  });
};

/**移出坐席组 */
export const moveOutSeatGroup = (data: {
  seatGroupId: number;
  seatIds: Array<number>;
}): Promise<Result<null>> => {
  return $http.post({
    url: '/sso/seatGroup/seatmoveout',
    data,
  });
};
